﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using mercadopago;
using System.Collections;
using EstacionDePoder.Codigo;

namespace EstacionDePoder.Tienda
{
    public partial class PagoTest : FormGenerico
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MP mp = new MP("2809942560114322", "EPAACOss5ROmavKhnyNRouGpaV2M0kWb");
            mp.sandboxMode(true);
            
            Hashtable preference = mp.createPreference("{\"items\":[{\"title\":\"sdk-dotnet\",\"quantity\":1,\"currency_id\":\"ARS\",\"unit_price\":10.5}] }");
            var pija = ((Hashtable)preference["response"])["sandbox_init_point"];
            btnPagar.PostBackUrl = pija.ToString();
        }
    }
}